package de.voicegym.voicegym.menu.settings

import android.os.Bundle
import android.preference.PreferenceActivity
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.appcompat.app.AppCompatActivity
import de.voicegym.voicegym.R

/**
 * A [PreferenceActivity] that presents a set of application settings. On
 * handset devices, settings are presented as a single list. On tablets,
 * settings are split by category, with category headers shown to the left of
 * the list of settings.
 *
 * See [Android Design: Settings](http://developer.android.com/design/patterns/settings.html)
 * for design guidelines and the [Settings API Guide](http://developer.android.com/guide/topics/ui/settings.html)
 * for more information on developing a Settings UI.
 */
class SettingsActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val frameLayout = FrameLayout(this)
        frameLayout.id = R.id.contentFragment

        val matchParent = ViewGroup.LayoutParams.MATCH_PARENT
        setContentView(frameLayout, FrameLayout.LayoutParams(matchParent, matchParent))

        val ft = supportFragmentManager.beginTransaction()
        val contentFragment = SettingsFragment()
        ft.add(R.id.contentFragment, contentFragment)
        ft.commit()

    }

}
